import React, { Component } from 'react';
import { Affix, Button } from 'antd';
import MentionBtn from '../../request/btns/mention-btn';
import Condition from 'components/condition';

const { If } = Condition;

class AffixButton extends Component {

  refreshHistory = (flag) => {
    flag && this.props.refreshHistory();
  };

  render() {
    const { buttons, className, loading} = this.props;
    return (
      <Affix offsetBottom={0} className={`bottom-bar ${className}`}>
        {
          buttons.map(item => React.createElement(Button, { ...item.params, loading }, item.child))
        }
      </Affix>
    );
  }
}

AffixButton.propTypes = {};

export default AffixButton;
